import java.util.*;
public class Main
{
    public static boolean isBrother(char[] str1, char[] str2)
    {
        //长度相同
        if(str1.length != str2.length)
        return false;
        //内容不同
        String strA = new String(str1);
        String strB = new String(str2);
        if(strA.equals(strB))
        return false;
        //排序之后,内容相同
        Arrays.sort(str1);
        Arrays.sort(str2);
        strA = new String(str1);
        strB = new String(str2);
        return strA.equals(strB);
    }
    public static void main(String[] args)
    {
    Scanner s = new Scanner(System.in);
    while(s.hasNextLine())
    {
    String[] str = s.nextLine().split(" ");
    int n = Integer.parseInt(str[0]);
    String[] arr = new String[n];
    for(int i = 0; i < n; ++i)
    arr[i] = str[i + 1];
    //单词x
    String curStr = str[n + 1];
    int k = Integer.parseInt(str[n + 2]);
    //给数组进行排序
    Arrays.sort(arr);
    int count = 0;
    String kStr = "";
    for(String e : arr)
    {
    if(isBrother(e.toCharArray(), curStr.toCharArray()))
    {
    count++;
    //判断是否为第k个兄弟单词
    if(count == k)
    {
    kStr = e;
    }
    }
    }
        System.out.println(count);
    if(count >= k)
    System.out.println(kStr);
    }
    }
}